/**
 * 
 */
package com.termdev.droidguard.utils;

import java.util.List;
import java.util.Map;

import org.json.JSONObject;

/**
 * @author Ternence
 *
 */
public class JSONUtils {
	public static String converObjectToJSONString(List<Map<String,String>> list,String titleFlag){
		StringBuilder sb=new StringBuilder("{");
		sb.append("\""+titleFlag+"\":");
		sb.append("[");
		if(list.size()>0){
			for(Map<String,String> map:list){
				JSONObject jsonObject=new JSONObject(map);
				sb.append(jsonObject.toString());
				sb.append(",");
			}
			sb.deleteCharAt(sb.length()-1);
		}
		sb.append("]");
		sb.append("}");
		return sb.toString(); 
	}
}
 